package com.ywjt.platformbusiness.store.adapter;

import android.widget.TextView;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ywjt.platformbusiness.R;
import com.ywjt.platformbusiness.store.model.SkuModel2;

import java.util.List;

public class StoreAddGoods1Adapter extends BaseQuickAdapter<SkuModel2, BaseViewHolder> {

    StringBuilder strSku=null;
    public StoreAddGoods1Adapter(@Nullable List<SkuModel2> data) {
        super(R.layout.item_goodsadd, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SkuModel2 item) {
        TextView tvSku=helper.getView(R.id.tvSku);

        helper.setText(R.id.tvPrice,item.getPrice()+"");
        helper.setText(R.id.tvStock,item.getStock());


        helper.addOnClickListener(R.id.ivDel);
        helper.addOnClickListener(R.id.llSkuSelect);
        helper.addOnClickListener(R.id.tvPrice);
        helper.addOnClickListener(R.id.tvStock);

        strSku=new StringBuilder();
        for(int i=0;i<item.getGoodsSkuVOList().size();i++){
            strSku.append(" "+item.getGoodsSkuVOList().get(i).getValue());
        }

        helper.setText(R.id.tvSku,"规格："+strSku);
    }
}
